Skip to main content

Providers

Overview (C4 Component)

Black-box description of components

ComponentResponsibilityProvided Interface(s)Consumed Interface(s)
ProviderControllerEntry point for provider CRUD & query.REST /api/v1/providers/** (OpenAPI)
ProviderServiceExecutes use-cases (create, update, search); enforces authorisation and builds pageable queries.Spring service APIProviderRepository, ProviderSpecificationFactory, ProviderMapper, CurrentUserService
ProviderRepositoryPersistence of Provider aggregate; supports dynamic Specifications & paging.Spring-Data JPAMySQL via JDBC
*ProviderSpecificationBuilderComposes JPA Specification<Provider> from provider+truck filter DTOs.Java classTruckSpecificationBuilder (fleet module)
ProviderMapper / AddressMapper / ContactMapperMapStruct converters between entities/embeddables and DTOs.Java interface
Entities & Embeddables (Provider, Address, Contact)ORM layer mapping; Provider contains @Formula fields for rating and confirmed-quote count.JPA

Important internal interfaces

NameSignature / ProtocolNotes
createProviderPOST /api/v1/providers – body ProviderRequestES admin only; returns 201 Created + Location header with ops-code URI.
getProvidersGET /api/v1/providers – query params: name, opsCode, countryOfOperations, techSpecs (Base64 JSON), paging & sortingBuilds combined Provider+Truck filter; responds with list of ProviderListItem.
getProviderByOpsCodeGET /api/v1/providers/{opsCode}Public for authenticated users.
updateProviderPUT /api/v1/providers/{opsCode}Allowed for ES admin or the provider itself; rejects ops-code mismatch.